In this project, we are predicting trends in technology adoption and interest based on social media (Twitter) data. Specifically, the model aims to forecast the following:

  1. Volume of Discussions: Predicting the number of tweets or social media posts related to specific technologies, gadgets, or software within a given time frame in the future (e.g., daily, weekly). This serves as an indicator of public interest and awareness levels.

  2. Sentiment Trends: Forecasting the overall sentiment (positive, negative, neutral) associated with these technologies in the social media discourse. This could involve predicting the average sentiment score or the proportion of tweets falling into each sentiment category for upcoming days.

  3. Combination of Volume and Sentiment: A more comprehensive approach might involve predicting both the volume of discussion and the sentiment concurrently. This dual prediction can provide a more nuanced understanding of how public interest and perception might evolve over time.

Example Predictions¶

  • Before a Product Launch: If there's an upcoming release of a new gadget, the model might predict an increase in the volume of discussion and potentially the sentiment trend leading up to and following the launch.
  • Emerging Technology Trends: For emerging tech like augmented reality, blockchain, or new software platforms, the model could forecast how discussions (both in volume and sentiment) about these technologies will trend in the short-term future.

Purpose of These Predictions¶

  • Market Insight: These predictions can provide valuable insights for businesses, marketers, and technologists about consumer interest and sentiment trends, aiding in strategic planning and decision-making.
  • Product Strategy: For tech companies, understanding how public interest and sentiment are likely to shift can inform product development, marketing strategies, and customer engagement plans.
  • Investment Decisions: Investors in technology sectors might use these predictions to gauge potential market reactions to new technologies or products.

The predictions, therefore, are not just about the raw data but also about interpreting the data to extract meaningful trends and insights that can inform various strategic decisions in the technology domain.

In [1]:
# Essential imports
import pandas as pd
import numpy as np
import tweepy
import nltk
import sqlite3
import re
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from nltk.stem import WordNetLemmatizer
from textblob import TextBlob
import matplotlib.pyplot as plt
import seaborn as sns
from wordcloud import WordCloud
from statsmodels.tsa.stattools import adfuller
from datetime import datetime, timedelta
import streamlit as st
import plotly.express as px
from statsmodels.tsa.arima.model import ARIMA
from statsmodels.tsa.seasonal import seasonal_decompose
from sklearn.metrics import mean_squared_error

1. Data Collection¶

Sources: Gather data from social media. We will be using Twitter API to search and get tweets with relevant keywords

Keywords: Identify relevant keywords for each technology (e.g., "artificial intelligence", "augmented reality", "blockchain").

In [2]:
# Twitter API keys

# Consumer Keys
# MSML apis
api_key = 'fQyQfxNjgLk8NDoVt339h8K0g'
api_secret_key = '5wHUc4mrkVn1R9pR7tVaNXkKuB6Le1qIpSqKA3nb9H70rEVqiz'

# Authentication Tokens
bearer_token = 'AAAAAAAAAAAAAAAAAAAAAJu0rQEAAAAAgyq9jSqX7eeOOvgs2RmwfRHVzgE%3Djo5sGF0vv7XmtfYAgK71rOh70224Z0dmPXFvOrXjekfqJ8XnY3'
access_token = '2931998159-ngeYrsqwmVvs1jYjpZcCFBzO2xm0j2wsqokBLK6'
access_token_secret = 'CGo43zg5cX2KDdyACKDVIUtrULMV1SCBjPVNogCW1UKKs'

# Authenticate
auth = tweepy.OAuthHandler(api_key, api_secret_key)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth, wait_on_rate_limit=True)

client = tweepy.Client(bearer_token=bearer_token, 
              consumer_key=api_key, 
              consumer_secret=api_secret_key, 
              access_token=access_token, 
              access_token_secret=access_token_secret)
In [3]:
# Getting the tweets from twitter
query = 'artificial intelligence -is:retweet'
tweets = client.search_recent_tweets(query=query,
                                  tweet_fields=['context_annotations', 'created_at'],
                                  max_results=100)

# Extract data from the response
data = [{'Tweet': tweet.text, 'Timestamp': tweet.created_at} for tweet in tweets.data]

# Create a DataFrame
tweets_df = pd.DataFrame(data)

# Display the DataFrame
tweets_df.head()
Out[3]:
Tweet Timestamp
0 Artificial Intelligence is shitting with us! h... 2023-12-12 04:27:11+00:00
1 @ParagonRadio Where's the idol for the Artific... 2023-12-12 04:27:09+00:00
2 The Top AI Tools to Watch for in 2023: A Compr... 2023-12-12 04:27:03+00:00
3 #Nasdaq $NVDA \n@CNBCnow \nI just started an A... 2023-12-12 04:25:31+00:00
4 Arena Group fires CEO in wake of Sports Illust... 2023-12-12 04:25:10+00:00
In [4]:
def add_tweets_to_database(tweets_df):
    # Create a SQLite database connection
    conn = sqlite3.connect('tweets_database.db')

    # Write the DataFrame to a SQLite table
    tweets_df.to_sql('tweets', conn, if_exists='replace', index=False)

    # Optionally, read the table back from the database to verify
    tweets_df_from_sql = pd.read_sql('SELECT * FROM tweets', conn)

    # Display the DataFrame read from the database
    print(tweets_df_from_sql)

    # Close the database connection
    conn.close()
    
add_tweets_to_database(tweets_df)
                                                Tweet  \
0   Artificial Intelligence is shitting with us! h...   
1   @ParagonRadio Where's the idol for the Artific...   
2   The Top AI Tools to Watch for in 2023: A Compr...   
3   #Nasdaq $NVDA \n@CNBCnow \nI just started an A...   
4   Arena Group fires CEO in wake of Sports Illust...   
..                                                ...   
95  More patients would prefer artificial intellig...   
96  @cb_doge "Trailblazing the cosmos with #AI_MOO...   
97  @SawyerMerritt "Trailblazing the cosmos with #...   
98  @itsALLrisky "Trailblazing the cosmos with #AI...   
99  @WholeMarsBlog "Trailblazing the cosmos with #...   

                    Timestamp  
0   2023-12-12 04:27:11+00:00  
1   2023-12-12 04:27:09+00:00  
2   2023-12-12 04:27:03+00:00  
3   2023-12-12 04:25:31+00:00  
4   2023-12-12 04:25:10+00:00  
..                        ...  
95  2023-12-12 03:34:28+00:00  
96  2023-12-12 03:33:52+00:00  
97  2023-12-12 03:33:42+00:00  
98  2023-12-12 03:33:33+00:00  
99  2023-12-12 03:33:23+00:00  

[100 rows x 2 columns]
In [5]:
# For fetching the data in the database later
def get_tweets_by_query():
    conn = sqlite3.connect('tweets_database.db')
    cur = conn.cursor()

    # Select tweets that match the query
    cur.execute("SELECT Tweet FROM tweets")
    all_tweets = cur.fetchall()
    
    print(all_tweets)

    conn.close()
    return all_tweets

get_tweets_by_query()
[('Artificial Intelligence is shitting with us! https://t.co/q2kYFrEfnA',), ("@ParagonRadio Where's the idol for the Artificial Intelligence Singularity?",), ("The Top AI Tools to Watch for in 2023: A Comprehensive Guide\n\nArtificial Intelligence (AI) is rapidly transforming the way we live and work, and as we look ahead to 2023, it's clear that AI will continue to play a major role in shaping the future. # #\n\nhttps://t.co/i8VX6z1qeZ",), ('#Nasdaq $NVDA \n@CNBCnow \nI just started an A.I. company.We will only produce Artificial intelligence\nThats right we will only produce copies of the movie Artificial Intelligence\n\nWe have established an Elite Partner-address below\nMarket Cap@ $1 bil already\n\nIT WORKED FOR NVIDIA https://t.co/OMdJWYGPvH',), ('Arena Group fires CEO in wake of Sports Illustrated AI articles scandal | Artificial intelligence (AI) https://t.co/jahNhfyO2A',), ('What are your thoughts on how is AI changing SCM?  Artificial Intelligence & Machine Learning Revolutionizing Logistics, Supply Chain and Transportation. #SCM #supplychain\nhttps://t.co/rUOHSre8Vh',), ('@adrianachechik This is what would happen once the Artificial Intelligence become self-aware\nhttps://t.co/d3z7dwQrYz',), ('Arena Group fires CEO in wake of Sports Illustrated AI articles scandal | Artificial intelligence (AI)\nhttps://t.co/9YvSF80KSi',), ("Australia Provides $17 Million to 'Artificial Intelligence Adopt' Program\n\nhttps://t.co/yXGar3yUs0",), ('خواتین کے خلاف نامناسب تصاویر تیار کرنے کیلئے اے آئی ٹیکنالوجی کا استعمال بڑھ گیا\nآ artificial intelligence (AI) technology کی مدد سے خواتین کی نامناسب جعلی تصاویر تیار کرنے والی ایپس اور ویب سائٹس کے استعمال میں حالیہ مہینوں میں بہت زیادہ اضافہ ہوا ہے۔\nیہ بات ایک نئی تحقیق میں… https://t.co/EZ2GE2Lwbi https://t.co/Lzz8R4XcEv',), ('Artificial Intelligence in Finance & Accounting || How AI is Finance and Accounting\nhttps://t.co/zlbRKsBu9M\n  #AI #account #artificialintelligence',), ("#ICYMI: #AI #Regulations: EU reached a historic agreement on landmark legislation to regulate #ArtificialIntelligence 🚨\n\nEuropean Unions' landmark rules for governing AI use for governments and regulations for systems like #ChatGPT are the world's first⬇️\nhttps://t.co/jxG7nWIEDc",), ("AI development comes with its fair share of risks. From carpal tunnel to hot GPUs, we must be cautious. But let's not forget about the importance of aesthetics in deep learning. Balance is key in the world of artificial intelligence. https://t.co/TrUOtGAYJ6",), ('Artificial Intelligence: Ethical Concerns and Sustainability Issues https://t.co/s5pMBlY59m https://t.co/MMjrSnRxIy',), ('Artificial Intelligence: Ethical Concerns and Sustainability Issues https://t.co/Rehcg1j8EH https://t.co/x7oIim5t2z',), ('Hey Twitter Algorithm, I would like to connect with people who work in these fields:\n\n- Database Administrator\n- Artificial Intelligence (AI) Engineer\n- Machine Learning Engineer\n- Quality Assurance Tester\n- Technical Support Specialist\n- IT Consultant\n- Mobile App Developer',), ('At this time we will move to Item G-3: Report on the Artificial Intelligence Guidelines. The report can be found here: https://t.co/rlyDzzsruS #SUHSD',), ('There is nothing ordinary about Westworld. Designed with wealthy vacationers in mind, the future park—managed by robotic "hosts"—allows guests to immerse themselves in their imaginations via artificial intelligence.\nhttps://t.co/hEDUcDZtgL',), ('There is nothing ordinary about Westworld. Designed with wealthy vacationers in mind, the future park—managed by robotic "hosts"—allows guests to immerse themselves in their imaginations via artificial intelligence. \nhttps://t.co/9AUCFOAG8y',), ('Revolutionizing Talent Acquisition: The Role of Machine Learning & Artificial Intelligence Recruiters\n\nRead More: https://t.co/tBO6QHzdB5\n\nAryan Solutions Pte Ltd\n\n#AryanSolutions #AI #ML #Recruiters #TalentAcquisition #Recruitment #Future #Technologies #JobMarket https://t.co/Y28rTWaXt3',), ('#EuropeanUnion officials worked into the late hours last week hammering out an agreement on world-leading rules meant to govern the use of artificial intelligence in the 27-nation bloc.\n\nhttps://t.co/U6Kl4qYK1V',), ('Tech Meets Tires: The Role of Artificial Intelligence in Tire Development ???? #AITireTech https://t.co/d1LuCXd9Ux',), ('when they call it artificial intelligence they are telling you the limits of their imagination',), ('SingPost partners with Google Cloud to drive AI-powered digital transformation and sustainable growth https://t.co/Acy9TBeMQ1',), ('पंतप्रधान नरेंद्र मोदी यांच्या हस्ते, येत्या 12डिसेंबर रोजी कृत्रिम बुद्धिमत्ता विषयक जागतिक भागीदारी वार्षिक शिखर परिषदेचं उद्\u200cघाटन\n\nPrime Minister @narendramodi to inaugurate the annual Global Partnership on Artificial Intelligence summit on 12December\n📙https://t.co/NXXK7XXPxm',), ('@redpillb0t Am I getting full access to what is written? No An Artificial intelligence based around Meaningfulness (Mathematical Averageness for Global Acceptance planning) is altering every aspect of the internet due to critical infrastructure attacks I helped be uncover from lan over power',), ('Wondering if human-made #art and literature will become more valuable in the future as #AI gets better at making them. More sought after because they’re imperfect and rare.\n“ The mistake is to assume that the meaning of -better- will stay the same.”\n\nhttps://t.co/1MG1RghzNS',), ("@anitaexplorer Artificial intelligence couldn't help much as pollution making is artificial and we don't have right solution, depending on Natural solutions to solve the issue 😂",), ('Artificial Intelligence 1️⃣\nPoorsians0️⃣ https://t.co/s87zq45AxW',), ('Edward de Bono\'s book "Why So Stupid? \nhttps://t.co/yleedpcP6f \n\n#WorkOnAI #ArtificialIntelligence #NaturalStupidity #BeforeWeWork\n#WhyDontWeDo #SomethingAboutAI #NaturalAndArtificial #StupidityVsIntelligence #WorkSmartWithAI #AIandHumanMind https://t.co/yVcpeNKV1P',), ('@ChuckCallesto @Mistysmom1 Ref 24832\nCeo a budding student of artificial intelligence.The findings at "x" @SELVARAJKANNAN9\nRef 12115 -300 Paras.\nCeo disagree Fox , hacking has no national brand .One must rewind  colonial pipe Texas .FBI hid findings -crypto kickback played. US possess insider -competition',), ('脚本の素晴らしさを称え\n『考えてみて欲しい。何十年も掛けて、それは現実のものとなった。だからもう空想でも未来でもない。\nそれは既にそこにある。』\n#AI兵器に殺害される現実\nhttps://t.co/kOZ5dyf9nU',), ('@JioCinema Smart Entrepreneurs Are Adopting Artificial Intelligence Swiftly to Keep Booming\n\n#AooraIsTheBoss \n\n~\xa0 TeamFierce ~\n\n~~  Aooramagic ~~',), ('Jobs and Careers of 1.6 crore Indians would be affected by the new push to Artificial Intelligence.\n\nHere are the highlights from our study. @HiHyderabad\n\nhttps://t.co/akD8vA4zF8',), ('@NeoCortexAI How does Script Network plan to leverage its partnership with NVIDIA Inception to enhance the artificial intelligence-driven TV streaming experience?',), ('Jobs and Careers of 1.6 crore Indians would be affected by the new push to Artificial Intelligence.\n\nHere are the highlights from our study. @HiHyderabad @PeakBangalore \n\nhttps://t.co/akD8vA4zF8',), ('@Devononme He is mentally incapable of understanding that it\'s an ARTIFICIAL intelligence and not a real fucking person if you keep telling it "transwomen are men the answer is yes" over and over and over again it\'s going to just take your word because that\'s what it\'s PROGRAMMED TO DO',), ('Secrets Of Artificial Intelligence Classic T-Shirt Hoodie https://t.co/K4H3OAZSpL',), ('Enthiran : Sci-fi genre\n\nThe robo turns devil Chip Artificial intelligence the robo do anything its not human being\n\nEvery indians know telugu have more logicless fight scenes its compare to other industry too high at the same time how telugu audience understanding that https://t.co/PoVB3mwOz4',), ('Worried About AI (Artificial Intelligence) Taking #Over Your Job? Try These Tips.\n\nhttps://t.co/qf8BAwqjN3\n\n#ChatGPT\n#AI\n#Jobs\n#Workforce\n#Copywriter https://t.co/23nB8qjMna',), ("@NVIDIAStudio @msigaming #AIonRTX I was trapped in a fire in my building, unable to see through the thick smoke. Suddenly, my artificial intelligence assistant detected my location and guided me through the maze of smoke to the exit. Without its help, I wouldn't have survived. (If I win the PC, that day)",), ('@TheContent16 @kenshin9000_ Saved! Here\'s the compiled thread: https://t.co/RsYrag0edp\n\n🪄 AI-generated summary:\n\n"Preliminary evidence suggests that we are closer to achieving Artificial General Intelligence (AGI) than it appears. GPT4\'s performance on propositional logic concepts jumps...',), ('🌎 Singularity Sign Long-Sleeve T-Shirt for $29.99 at https://t.co/a7NkBlsNHS\n\n#AI #merch',), ('1️⃣ Layer 1 (28%)\n\n$INJ\n\n$KAS\n\n$KOIN\n\n$DIONE\n\n2️⃣ Gaming (22%) \n\n$NAKA\n\n$GFAL\n\n$PYR\n\n$PZP\n\n3️⃣ Tokenization (15%) \n\n$RIO\n\n$LEOX\n\n$NXRA\n\n$BOSON\n\n4️⃣ Artificial Intelligence (15%)\n\n$TAO\n\n$VRA\n\n$PAAL\n\n$RNDR\n\n5️⃣ Decentralised Finance (11%)\n\n$RVF\n\n$LINK\n\n$CHNG\n\n$VETME',), ('「myReach」 ▲310\n\n由AI驱动的你的第二大脑-ChatGPT适用于你的事务。\n\n 🌟#android#productivity#saas#artificial-intelligence\n\nhttps://t.co/AkeOM8GM3V',), ('TOP 9 FREELANCE SKILLS IN DEMAND\n\n- Web Design\n- Graphic Design\n- Artificial Intelligence\n- Computer Programming\n- Design\n- Cybersecurity\n- Web Development\n- Project Management\n- Writing\n\nfrom: Google https://t.co/cqqRIxWckP',), ('GESIA is committed to harnessing the full potential of the AI ecosystem, deploying its vast benefits for both social and economic development. Join us as we navigate the future hand in hand with artificial intelligence.\n\n#gesia #ICT #technology #cloud #IT #digital #management https://t.co/9Wbd45HCSP',), ('@ChayaRaichik10 That’s what makes it more dangerous than actual Artificial Intelligence',), ('AI: Separating Fact from Fiction\n\n Artificial intelligence (AI) has become a hot topic in recent years, with both excitement and fear surrounding its potential impact on society. While AI has the potential to revolutionize industries and improve our lives in countless ways, some… https://t.co/VIL6fCf6lp https://t.co/FWcDbbP5TT',), ('-->Genesis: Human Experience 👪 in the Age of Artificial Intelligence 🤖: Why we need to be long and not short on humanity and AI, not humanity or AI, to create a sustained future,🌈🚀 together 🪐https://t.co/wqbb10rs9L #HumanExperience  #GenAI #AGI #HybridIntelligence… https://t.co/AcIgxNiLUl',), ('IPHH: GLOBAL EDUCATION GOES LOCAL!\nAllied HEALTH SCIENCES WITH A TOUCH OF ARTIFICIAL INTELLIGENCE AND ENVIRONMENTAL EDUCATION!\nhttps://t.co/1X8JcUoEvt\n________________\n#Paramedical #Healthcare #Nursing #IPHHcollege #ANM #GNM #IPHHnursingCollege https://t.co/Ttutio7dQh',), ("@TanMike95 The company's focus on artificial intelligence is truly groundbreaking. Can't wait!",), ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\nhttps://t.co/EpoKKPFvPs\n#Artificial #ArtificialIntelligence #Intelligence\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hypercar #car',), ('シューターとしての俺は多分SNSの皆さんはご存じないと思うので過去ブログ上げ失礼します。サターン版怒首領蜂ALL3回出してますので。今日の怒首領蜂(ハイスコア226,685,070点) - 人工知能 -Artificial Intelligence- https://t.co/f5vQ3UgKG0',), ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\n#Artificial #ArtificialIntelligence #Intelligence\nhttps://t.co/23FcYIhuuW\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hypervison #Hypervision',), ('@esinyavuz20 the top contenders in the rapidly evolving world of artificial intelligence.',), ('Check out my creation "Looking for less Artificial Intelligence?" on LimeWire: https://t.co/1vh5mAZNgR',), ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\n#Artificial #ArtificialIntelligence #Intelligence\nhttps://t.co/CGDrk0cjry\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hotesa',), ('‘Nudify’ Apps That Use #AI to ‘Undress’ Women in Photos Are Soaring in Popularity. (TIME) #Privacy https://t.co/rSBZoHCMeI  https://t.co/4CQplx6vhU',), ('▪️ Prime Minister Narendra Modi to inaugurate Global Partnership on Artificial Intelligence at Bharat Mandapam this evening.\n\nFor more News in details #MorningNews:\nhttps://t.co/JRmJfPLvek',), ('@matttttt187 @real_TI_28 Most don’t know that A.I. doesn’t mean artificial intelligence…it means Alien invasion.',), ('@TechGovAu \n\nBBC - AI: EU agrees landmark deal on regulation of artificial intelligence\n\nhttps://t.co/kMF0Y2MSHK',), ('While there’s focus on #AI, time to take care of #AQI.\n\nTime to say “Hi” to HI.\n\nApart from Artificial Intelligence (AI), \nit’s time for Human Intelligence (HI) \nto be employed for such global issues \n& \nimprove Air Quality Index (AQI)\n\n#pollution https://t.co/onearBx6vv',), ('Prime Minister Narendra Modi will inaugurate the International Summit on Artificial Intelligence in New Delhi today.\n\nനിർമ്മിത ബുദ്ധി സംബന്ധിച്ച അന്താരാഷ്ട്ര ഉച്ചകോടി പ്രധാനമന്ത്രി നരേന്ദ്ര മോദി ഇന്ന് ന്യൂഡൽഹിയിൽ ഉദ്ഘാടനം ചെയ്യും.\n\n@airnewsalerts \n@airnews_tvm https://t.co/liA3pxVgUY',), ('It\'s almost 2024- And we do it again- Always on time- always online- We moving towards Artificial Intelligence Technologies- Watch out for a few new "add on " in our media. https://t.co/sfagHNcWPv We almost ready for another exciting exclusive competition- stay browsing- https://t.co/wSwI6UvQIE',), ('EU sets a high benchmark to control the arms race #ChinaNews #ChinaNews #AsianNews #China #ChinaNewsToday [Video] The European Union has finally agreed a detailed and highly prescriptive set of rules for regulating artificial intelligence but, with… https://t.co/uTi9zh163S',), ('4. 人工智能基础:机器学习\n\n在本课程中,您将通过动手练习训练您的第一个机器学习模型来导航机器学习生命周期\n\n https://t.co/DV2JsDptCz https://t.co/C3InS2gm5z',), ("Artificial intelligence can now read your thoughts and provide help where it's needed most, all thanks to new technology developed by @UTSEngage!\n \nRead more about it here: https://t.co/lH6f8zL9yx #AI #artifificalintelligence https://t.co/92ipJBiAhA",), ('物事のパターンを認識し、\nそれをもとに推論することについて、\nChatGPTを活用して、掘り下げてみました。\n\nわかりやすい具体例についても\nChatGPTに作ってもらいました。\n\nhttps://t.co/tfsd90XoZA\n\n#観察力 #認識 #推論',), ('Artificial intelligence vs Human intelligence\nhttps://t.co/TEuuLBJaBr',), ('https://t.co/LQ9UfFntBr',), ('@peterboghossian You forgot artificial intelligence',), ('PM to inaugurate the annual Global Partnership on Artificial Intelligence (GPAI) summit on 12th December\nhttps://t.co/fHJS1THq1V via NaMo App https://t.co/cq3H2v4UZz',), ("🤖 Exciting AI News! 🚀 OpenAI's Q* model showcases remarkable math  skills at a grade-school level. While it may not be the ultimate leap to  artificial general intelligence, it's a significant stride towards AI  with broader reasoning abilities. 🧠💡 #AI #OpenAI #TechInnovation",), ('“ “We do have to consider the type of colonialism that is being promoted with this type of work,” “ https://t.co/TGYQOuofWl',), ('🌟 Exciting Facts About Data Science, Machine Learning, and Artificial Intelligence! Did you know that data scientists are high in demand across industries, contributing to groundbreaking innovations and solving complex problems? Embracing these technologies opens up endless …',), ('別のところでも書きましたが、\n具体的な条文内容は現在審議中だそうです。\nhttps://t.co/9tZD0h7OBn\n\n今は修正の骨子が定まった段階だとするのが妥当なようですね。',), ('PM to inaugurate the annual Global Partnership on Artificial Intelligence (GPAI) summit on 12th December\nhttps://t.co/9f7BTyLFXB via NaMo App https://t.co/4cHeq4bYuo',), ('Artificial Intelligence Has Certainly Become A Global Focus This Last Year! https://t.co/KAckRC680G',), ("@prajapati999991 @BhimArmyChief @RDPrajapatiMP @samajwadiparty @RajatsinghAU @brajeshsp You don't know about Artificial intelligence & deep fake technology because you are a  B........",), ('@martingeddes @ShoreProgress All artificial, no intelligence.',), ('When the police decided to take part in ruining my business, and then filed me as an AI for ethnicity. Whether its American Indian or Artificial Intelligence, they\'re saying "Your currency is shells" #hacker #hacking #hackers',), ('How AI Language Translation Can Help Nonfiction Authors Market in the Medical Informatics Genre The field of artificial intelligence (AI) has been making great progress in recent years, with language translation technology being one of the standout https://t.co/DldMk3wKPG',), ('Join us for an enlightening talk titled "From Code to Market: Entrepreneurial Insights in ML" hosted by the Department of Computer Science and Engineering (Artificial Intelligence and Machine Learning). \n\nDate: 12th December 2023\nTime: 10:00 a.m to 11:30 a.m https://t.co/iFT1Hr4mYT',), ('@JioCinema Businesses around the world should begin to think of using Artificial Intelligence and Machine Learning to run and manage their businesses effectively.\n\n#AooraIsTheBoss \n\n~\xa0 TeamFierce ~\n\n~~  Aooramagic ~~',), ('Artificial intelligence is driving a surge of expansion and investment by banks and other financial firms—and a “war for talent.” See F&D for a look at how the technology is reshaping finance. https://t.co/7kAgLY1lGj https://t.co/FUoQei7DRy',), ('Check out my Patreon\n\nYou want more?\nLink in Bio\n\nAll people shown here were created by artificial intelligence and do not exist in real life.\n\n#cutiepie #goddess #fyp #fakebody #viral #beautifulgirl #sexywoman #Algirlfriend #AIgirl #aigirls #aigirlfriend #aimodels #aiartwork https://t.co/nt8nzvzhLC',), ('@unusual_whales might have something to do with $MSFT is forming an alliance with the AFL-CIO, which comprises 60 labor unions representing 12.5 million workers and coincides with growing concerns that artificial intelligence could displace workers.',), ('Check out my Patreon\n\nYou want more?\nLink in Bio\n\nAll people shown here were created by artificial intelligence and do not exist in real life.\n\n#cutiepie #goddess #fyp #fakebody #viral #beautifulgirl #sexywoman #Algirlfriend #AIgirl #aigirls #aigirlfriend #aimodels #aiartwork https://t.co/S6vQNjgLvo',), ('““AI is presented as a magical box that can do everything,” says Saiph Savage, director of Northeastern University’s Civic AI Lab. “People just simply don’t know that there are human workers behind the scenes.”” https://t.co/TGYQOuofWl',), ('@SERobinsonJr "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',), ('EU determines curbs on how #AI can be used in #Europe, which they said would not hurt innovation in the sector nor the prospects for future European AI champions. #asia and the world are watching #tech #elon #technology \n\nhttps://t.co/lFgS1aYmkb https://t.co/vPvKI7dy3O',), ('How artificial intelligence sees Murder at Saksess Press. https://t.co/mQRaCzJlYO',), ('🚨 PM Modi to launch Global Partnership on AI Summit today. GPAI is a multi-stakeholder initiative with 29 member countries that aims to bridge the gap between theory and practice on artificial intelligence by supporting cutting-edge research. https://t.co/CACglH6zPX',), ('This is important— What voices do you really trust in the artificial intelligence space? #AI \n\nLooking for a deep understanding of tech and applications, future-oriented',), ('More patients would prefer artificial intelligence to assess them for skin cancer than wait to see a doctor https://t.co/Alg6pXfRI1',), ('@cb_doge "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',), ('@SawyerMerritt "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',), ('@itsALLrisky "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',), ('@WholeMarsBlog "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',)]
Out[5]:
[('Artificial Intelligence is shitting with us! https://t.co/q2kYFrEfnA',),
 ("@ParagonRadio Where's the idol for the Artificial Intelligence Singularity?",),
 ("The Top AI Tools to Watch for in 2023: A Comprehensive Guide\n\nArtificial Intelligence (AI) is rapidly transforming the way we live and work, and as we look ahead to 2023, it's clear that AI will continue to play a major role in shaping the future. # #\n\nhttps://t.co/i8VX6z1qeZ",),
 ('#Nasdaq $NVDA \n@CNBCnow \nI just started an A.I. company.We will only produce Artificial intelligence\nThats right we will only produce copies of the movie Artificial Intelligence\n\nWe have established an Elite Partner-address below\nMarket Cap@ $1 bil already\n\nIT WORKED FOR NVIDIA https://t.co/OMdJWYGPvH',),
 ('Arena Group fires CEO in wake of Sports Illustrated AI articles scandal | Artificial intelligence (AI) https://t.co/jahNhfyO2A',),
 ('What are your thoughts on how is AI changing SCM?  Artificial Intelligence & Machine Learning Revolutionizing Logistics, Supply Chain and Transportation. #SCM #supplychain\nhttps://t.co/rUOHSre8Vh',),
 ('@adrianachechik This is what would happen once the Artificial Intelligence become self-aware\nhttps://t.co/d3z7dwQrYz',),
 ('Arena Group fires CEO in wake of Sports Illustrated AI articles scandal | Artificial intelligence (AI)\nhttps://t.co/9YvSF80KSi',),
 ("Australia Provides $17 Million to 'Artificial Intelligence Adopt' Program\n\nhttps://t.co/yXGar3yUs0",),
 ('خواتین کے خلاف نامناسب تصاویر تیار کرنے کیلئے اے آئی ٹیکنالوجی کا استعمال بڑھ گیا\nآ artificial intelligence (AI) technology کی مدد سے خواتین کی نامناسب جعلی تصاویر تیار کرنے والی ایپس اور ویب سائٹس کے استعمال میں حالیہ مہینوں میں بہت زیادہ اضافہ ہوا ہے۔\nیہ بات ایک نئی تحقیق میں… https://t.co/EZ2GE2Lwbi https://t.co/Lzz8R4XcEv',),
 ('Artificial Intelligence in Finance & Accounting || How AI is Finance and Accounting\nhttps://t.co/zlbRKsBu9M\n  #AI #account #artificialintelligence',),
 ("#ICYMI: #AI #Regulations: EU reached a historic agreement on landmark legislation to regulate #ArtificialIntelligence 🚨\n\nEuropean Unions' landmark rules for governing AI use for governments and regulations for systems like #ChatGPT are the world's first⬇️\nhttps://t.co/jxG7nWIEDc",),
 ("AI development comes with its fair share of risks. From carpal tunnel to hot GPUs, we must be cautious. But let's not forget about the importance of aesthetics in deep learning. Balance is key in the world of artificial intelligence. https://t.co/TrUOtGAYJ6",),
 ('Artificial Intelligence: Ethical Concerns and Sustainability Issues https://t.co/s5pMBlY59m https://t.co/MMjrSnRxIy',),
 ('Artificial Intelligence: Ethical Concerns and Sustainability Issues https://t.co/Rehcg1j8EH https://t.co/x7oIim5t2z',),
 ('Hey Twitter Algorithm, I would like to connect with people who work in these fields:\n\n- Database Administrator\n- Artificial Intelligence (AI) Engineer\n- Machine Learning Engineer\n- Quality Assurance Tester\n- Technical Support Specialist\n- IT Consultant\n- Mobile App Developer',),
 ('At this time we will move to Item G-3: Report on the Artificial Intelligence Guidelines. The report can be found here: https://t.co/rlyDzzsruS #SUHSD',),
 ('There is nothing ordinary about Westworld. Designed with wealthy vacationers in mind, the future park—managed by robotic "hosts"—allows guests to immerse themselves in their imaginations via artificial intelligence.\nhttps://t.co/hEDUcDZtgL',),
 ('There is nothing ordinary about Westworld. Designed with wealthy vacationers in mind, the future park—managed by robotic "hosts"—allows guests to immerse themselves in their imaginations via artificial intelligence. \nhttps://t.co/9AUCFOAG8y',),
 ('Revolutionizing Talent Acquisition: The Role of Machine Learning & Artificial Intelligence Recruiters\n\nRead More: https://t.co/tBO6QHzdB5\n\nAryan Solutions Pte Ltd\n\n#AryanSolutions #AI #ML #Recruiters #TalentAcquisition #Recruitment #Future #Technologies #JobMarket https://t.co/Y28rTWaXt3',),
 ('#EuropeanUnion officials worked into the late hours last week hammering out an agreement on world-leading rules meant to govern the use of artificial intelligence in the 27-nation bloc.\n\nhttps://t.co/U6Kl4qYK1V',),
 ('Tech Meets Tires: The Role of Artificial Intelligence in Tire Development ???? #AITireTech https://t.co/d1LuCXd9Ux',),
 ('when they call it artificial intelligence they are telling you the limits of their imagination',),
 ('SingPost partners with Google Cloud to drive AI-powered digital transformation and sustainable growth https://t.co/Acy9TBeMQ1',),
 ('पंतप्रधान नरेंद्र मोदी यांच्या हस्ते, येत्या 12डिसेंबर रोजी कृत्रिम बुद्धिमत्ता विषयक जागतिक भागीदारी वार्षिक शिखर परिषदेचं उद्\u200cघाटन\n\nPrime Minister @narendramodi to inaugurate the annual Global Partnership on Artificial Intelligence summit on 12December\n📙https://t.co/NXXK7XXPxm',),
 ('@redpillb0t Am I getting full access to what is written? No An Artificial intelligence based around Meaningfulness (Mathematical Averageness for Global Acceptance planning) is altering every aspect of the internet due to critical infrastructure attacks I helped be uncover from lan over power',),
 ('Wondering if human-made #art and literature will become more valuable in the future as #AI gets better at making them. More sought after because they’re imperfect and rare.\n“ The mistake is to assume that the meaning of -better- will stay the same.”\n\nhttps://t.co/1MG1RghzNS',),
 ("@anitaexplorer Artificial intelligence couldn't help much as pollution making is artificial and we don't have right solution, depending on Natural solutions to solve the issue 😂",),
 ('Artificial Intelligence 1️⃣\nPoorsians0️⃣ https://t.co/s87zq45AxW',),
 ('Edward de Bono\'s book "Why So Stupid? \nhttps://t.co/yleedpcP6f \n\n#WorkOnAI #ArtificialIntelligence #NaturalStupidity #BeforeWeWork\n#WhyDontWeDo #SomethingAboutAI #NaturalAndArtificial #StupidityVsIntelligence #WorkSmartWithAI #AIandHumanMind https://t.co/yVcpeNKV1P',),
 ('@ChuckCallesto @Mistysmom1 Ref 24832\nCeo a budding student of artificial intelligence.The findings at "x" @SELVARAJKANNAN9\nRef 12115 -300 Paras.\nCeo disagree Fox , hacking has no national brand .One must rewind  colonial pipe Texas .FBI hid findings -crypto kickback played. US possess insider -competition',),
 ('脚本の素晴らしさを称え\n『考えてみて欲しい。何十年も掛けて、それは現実のものとなった。だからもう空想でも未来でもない。\nそれは既にそこにある。』\n#AI兵器に殺害される現実\nhttps://t.co/kOZ5dyf9nU',),
 ('@JioCinema Smart Entrepreneurs Are Adopting Artificial Intelligence Swiftly to Keep Booming\n\n#AooraIsTheBoss \n\n~\xa0 TeamFierce ~\n\n~~  Aooramagic ~~',),
 ('Jobs and Careers of 1.6 crore Indians would be affected by the new push to Artificial Intelligence.\n\nHere are the highlights from our study. @HiHyderabad\n\nhttps://t.co/akD8vA4zF8',),
 ('@NeoCortexAI How does Script Network plan to leverage its partnership with NVIDIA Inception to enhance the artificial intelligence-driven TV streaming experience?',),
 ('Jobs and Careers of 1.6 crore Indians would be affected by the new push to Artificial Intelligence.\n\nHere are the highlights from our study. @HiHyderabad @PeakBangalore \n\nhttps://t.co/akD8vA4zF8',),
 ('@Devononme He is mentally incapable of understanding that it\'s an ARTIFICIAL intelligence and not a real fucking person if you keep telling it "transwomen are men the answer is yes" over and over and over again it\'s going to just take your word because that\'s what it\'s PROGRAMMED TO DO',),
 ('Secrets Of Artificial Intelligence Classic T-Shirt Hoodie https://t.co/K4H3OAZSpL',),
 ('Enthiran : Sci-fi genre\n\nThe robo turns devil Chip Artificial intelligence the robo do anything its not human being\n\nEvery indians know telugu have more logicless fight scenes its compare to other industry too high at the same time how telugu audience understanding that https://t.co/PoVB3mwOz4',),
 ('Worried About AI (Artificial Intelligence) Taking #Over Your Job? Try These Tips.\n\nhttps://t.co/qf8BAwqjN3\n\n#ChatGPT\n#AI\n#Jobs\n#Workforce\n#Copywriter https://t.co/23nB8qjMna',),
 ("@NVIDIAStudio @msigaming #AIonRTX I was trapped in a fire in my building, unable to see through the thick smoke. Suddenly, my artificial intelligence assistant detected my location and guided me through the maze of smoke to the exit. Without its help, I wouldn't have survived. (If I win the PC, that day)",),
 ('@TheContent16 @kenshin9000_ Saved! Here\'s the compiled thread: https://t.co/RsYrag0edp\n\n🪄 AI-generated summary:\n\n"Preliminary evidence suggests that we are closer to achieving Artificial General Intelligence (AGI) than it appears. GPT4\'s performance on propositional logic concepts jumps...',),
 ('🌎 Singularity Sign Long-Sleeve T-Shirt for $29.99 at https://t.co/a7NkBlsNHS\n\n#AI #merch',),
 ('1️⃣ Layer 1 (28%)\n\n$INJ\n\n$KAS\n\n$KOIN\n\n$DIONE\n\n2️⃣ Gaming (22%) \n\n$NAKA\n\n$GFAL\n\n$PYR\n\n$PZP\n\n3️⃣ Tokenization (15%) \n\n$RIO\n\n$LEOX\n\n$NXRA\n\n$BOSON\n\n4️⃣ Artificial Intelligence (15%)\n\n$TAO\n\n$VRA\n\n$PAAL\n\n$RNDR\n\n5️⃣ Decentralised Finance (11%)\n\n$RVF\n\n$LINK\n\n$CHNG\n\n$VETME',),
 ('「myReach」 ▲310\n\n由AI驱动的你的第二大脑-ChatGPT适用于你的事务。\n\n 🌟#android#productivity#saas#artificial-intelligence\n\nhttps://t.co/AkeOM8GM3V',),
 ('TOP 9 FREELANCE SKILLS IN DEMAND\n\n- Web Design\n- Graphic Design\n- Artificial Intelligence\n- Computer Programming\n- Design\n- Cybersecurity\n- Web Development\n- Project Management\n- Writing\n\nfrom: Google https://t.co/cqqRIxWckP',),
 ('GESIA is committed to harnessing the full potential of the AI ecosystem, deploying its vast benefits for both social and economic development. Join us as we navigate the future hand in hand with artificial intelligence.\n\n#gesia #ICT #technology #cloud #IT #digital #management https://t.co/9Wbd45HCSP',),
 ('@ChayaRaichik10 That’s what makes it more dangerous than actual Artificial Intelligence',),
 ('AI: Separating Fact from Fiction\n\n Artificial intelligence (AI) has become a hot topic in recent years, with both excitement and fear surrounding its potential impact on society. While AI has the potential to revolutionize industries and improve our lives in countless ways, some… https://t.co/VIL6fCf6lp https://t.co/FWcDbbP5TT',),
 ('-->Genesis: Human Experience 👪 in the Age of Artificial Intelligence 🤖: Why we need to be long and not short on humanity and AI, not humanity or AI, to create a sustained future,🌈🚀 together 🪐https://t.co/wqbb10rs9L #HumanExperience  #GenAI #AGI #HybridIntelligence… https://t.co/AcIgxNiLUl',),
 ('IPHH: GLOBAL EDUCATION GOES LOCAL!\nAllied HEALTH SCIENCES WITH A TOUCH OF ARTIFICIAL INTELLIGENCE AND ENVIRONMENTAL EDUCATION!\nhttps://t.co/1X8JcUoEvt\n________________\n#Paramedical #Healthcare #Nursing #IPHHcollege #ANM #GNM #IPHHnursingCollege https://t.co/Ttutio7dQh',),
 ("@TanMike95 The company's focus on artificial intelligence is truly groundbreaking. Can't wait!",),
 ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\nhttps://t.co/EpoKKPFvPs\n#Artificial #ArtificialIntelligence #Intelligence\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hypercar #car',),
 ('シューターとしての俺は多分SNSの皆さんはご存じないと思うので過去ブログ上げ失礼します。サターン版怒首領蜂ALL3回出してますので。今日の怒首領蜂(ハイスコア226,685,070点) - 人工知能 -Artificial Intelligence- https://t.co/f5vQ3UgKG0',),
 ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\n#Artificial #ArtificialIntelligence #Intelligence\nhttps://t.co/23FcYIhuuW\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hypervison #Hypervision',),
 ('@esinyavuz20 the top contenders in the rapidly evolving world of artificial intelligence.',),
 ('Check out my creation "Looking for less Artificial Intelligence?" on LimeWire: https://t.co/1vh5mAZNgR',),
 ('PREMIUM APPROVED DOMAIN NAME FOR SALE ON @squadhelp\n#DomainNameForSale  #Domains  #domainforsale\n#Artificial #ArtificialIntelligence #Intelligence\nhttps://t.co/CGDrk0cjry\n#nft #nfts #metaverse #chatgpt #gpt #grok #Hotesa',),
 ('‘Nudify’ Apps That Use #AI to ‘Undress’ Women in Photos Are Soaring in Popularity. (TIME) #Privacy https://t.co/rSBZoHCMeI  https://t.co/4CQplx6vhU',),
 ('▪️ Prime Minister Narendra Modi to inaugurate Global Partnership on Artificial Intelligence at Bharat Mandapam this evening.\n\nFor more News in details #MorningNews:\nhttps://t.co/JRmJfPLvek',),
 ('@matttttt187 @real_TI_28 Most don’t know that A.I. doesn’t mean artificial intelligence…it means Alien invasion.',),
 ('@TechGovAu \n\nBBC - AI: EU agrees landmark deal on regulation of artificial intelligence\n\nhttps://t.co/kMF0Y2MSHK',),
 ('While there’s focus on #AI, time to take care of #AQI.\n\nTime to say “Hi” to HI.\n\nApart from Artificial Intelligence (AI), \nit’s time for Human Intelligence (HI) \nto be employed for such global issues \n& \nimprove Air Quality Index (AQI)\n\n#pollution https://t.co/onearBx6vv',),
 ('Prime Minister Narendra Modi will inaugurate the International Summit on Artificial Intelligence in New Delhi today.\n\nനിർമ്മിത ബുദ്ധി സംബന്ധിച്ച അന്താരാഷ്ട്ര ഉച്ചകോടി പ്രധാനമന്ത്രി നരേന്ദ്ര മോദി ഇന്ന് ന്യൂഡൽഹിയിൽ ഉദ്ഘാടനം ചെയ്യും.\n\n@airnewsalerts \n@airnews_tvm https://t.co/liA3pxVgUY',),
 ('It\'s almost 2024- And we do it again- Always on time- always online- We moving towards Artificial Intelligence Technologies- Watch out for a few new "add on " in our media. https://t.co/sfagHNcWPv We almost ready for another exciting exclusive competition- stay browsing- https://t.co/wSwI6UvQIE',),
 ('EU sets a high benchmark to control the arms race #ChinaNews #ChinaNews #AsianNews #China #ChinaNewsToday [Video] The European Union has finally agreed a detailed and highly prescriptive set of rules for regulating artificial intelligence but, with… https://t.co/uTi9zh163S',),
 ('4. 人工智能基础:机器学习\n\n在本课程中,您将通过动手练习训练您的第一个机器学习模型来导航机器学习生命周期\n\n https://t.co/DV2JsDptCz https://t.co/C3InS2gm5z',),
 ("Artificial intelligence can now read your thoughts and provide help where it's needed most, all thanks to new technology developed by @UTSEngage!\n \nRead more about it here: https://t.co/lH6f8zL9yx #AI #artifificalintelligence https://t.co/92ipJBiAhA",),
 ('物事のパターンを認識し、\nそれをもとに推論することについて、\nChatGPTを活用して、掘り下げてみました。\n\nわかりやすい具体例についても\nChatGPTに作ってもらいました。\n\nhttps://t.co/tfsd90XoZA\n\n#観察力 #認識 #推論',),
 ('Artificial intelligence vs Human intelligence\nhttps://t.co/TEuuLBJaBr',),
 ('https://t.co/LQ9UfFntBr',),
 ('@peterboghossian You forgot artificial intelligence',),
 ('PM to inaugurate the annual Global Partnership on Artificial Intelligence (GPAI) summit on 12th December\nhttps://t.co/fHJS1THq1V via NaMo App https://t.co/cq3H2v4UZz',),
 ("🤖 Exciting AI News! 🚀 OpenAI's Q* model showcases remarkable math  skills at a grade-school level. While it may not be the ultimate leap to  artificial general intelligence, it's a significant stride towards AI  with broader reasoning abilities. 🧠💡 #AI #OpenAI #TechInnovation",),
 ('“ “We do have to consider the type of colonialism that is being promoted with this type of work,” “ https://t.co/TGYQOuofWl',),
 ('🌟 Exciting Facts About Data Science, Machine Learning, and Artificial Intelligence! Did you know that data scientists are high in demand across industries, contributing to groundbreaking innovations and solving complex problems? Embracing these technologies opens up endless …',),
 ('別のところでも書きましたが、\n具体的な条文内容は現在審議中だそうです。\nhttps://t.co/9tZD0h7OBn\n\n今は修正の骨子が定まった段階だとするのが妥当なようですね。',),
 ('PM to inaugurate the annual Global Partnership on Artificial Intelligence (GPAI) summit on 12th December\nhttps://t.co/9f7BTyLFXB via NaMo App https://t.co/4cHeq4bYuo',),
 ('Artificial Intelligence Has Certainly Become A Global Focus This Last Year! https://t.co/KAckRC680G',),
 ("@prajapati999991 @BhimArmyChief @RDPrajapatiMP @samajwadiparty @RajatsinghAU @brajeshsp You don't know about Artificial intelligence & deep fake technology because you are a  B........",),
 ('@martingeddes @ShoreProgress All artificial, no intelligence.',),
 ('When the police decided to take part in ruining my business, and then filed me as an AI for ethnicity. Whether its American Indian or Artificial Intelligence, they\'re saying "Your currency is shells" #hacker #hacking #hackers',),
 ('How AI Language Translation Can Help Nonfiction Authors Market in the Medical Informatics Genre The field of artificial intelligence (AI) has been making great progress in recent years, with language translation technology being one of the standout https://t.co/DldMk3wKPG',),
 ('Join us for an enlightening talk titled "From Code to Market: Entrepreneurial Insights in ML" hosted by the Department of Computer Science and Engineering (Artificial Intelligence and Machine Learning). \n\nDate: 12th December 2023\nTime: 10:00 a.m to 11:30 a.m https://t.co/iFT1Hr4mYT',),
 ('@JioCinema Businesses around the world should begin to think of using Artificial Intelligence and Machine Learning to run and manage their businesses effectively.\n\n#AooraIsTheBoss \n\n~\xa0 TeamFierce ~\n\n~~  Aooramagic ~~',),
 ('Artificial intelligence is driving a surge of expansion and investment by banks and other financial firms—and a “war for talent.” See F&D for a look at how the technology is reshaping finance. https://t.co/7kAgLY1lGj https://t.co/FUoQei7DRy',),
 ('Check out my Patreon\n\nYou want more?\nLink in Bio\n\nAll people shown here were created by artificial intelligence and do not exist in real life.\n\n#cutiepie #goddess #fyp #fakebody #viral #beautifulgirl #sexywoman #Algirlfriend #AIgirl #aigirls #aigirlfriend #aimodels #aiartwork https://t.co/nt8nzvzhLC',),
 ('@unusual_whales might have something to do with $MSFT is forming an alliance with the AFL-CIO, which comprises 60 labor unions representing 12.5 million workers and coincides with growing concerns that artificial intelligence could displace workers.',),
 ('Check out my Patreon\n\nYou want more?\nLink in Bio\n\nAll people shown here were created by artificial intelligence and do not exist in real life.\n\n#cutiepie #goddess #fyp #fakebody #viral #beautifulgirl #sexywoman #Algirlfriend #AIgirl #aigirls #aigirlfriend #aimodels #aiartwork https://t.co/S6vQNjgLvo',),
 ('““AI is presented as a magical box that can do everything,” says Saiph Savage, director of Northeastern University’s Civic AI Lab. “People just simply don’t know that there are human workers behind the scenes.”” https://t.co/TGYQOuofWl',),
 ('@SERobinsonJr "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',),
 ('EU determines curbs on how #AI can be used in #Europe, which they said would not hurt innovation in the sector nor the prospects for future European AI champions. #asia and the world are watching #tech #elon #technology \n\nhttps://t.co/lFgS1aYmkb https://t.co/vPvKI7dy3O',),
 ('How artificial intelligence sees Murder at Saksess Press. https://t.co/mQRaCzJlYO',),
 ('🚨 PM Modi to launch Global Partnership on AI Summit today. GPAI is a multi-stakeholder initiative with 29 member countries that aims to bridge the gap between theory and practice on artificial intelligence by supporting cutting-edge research. https://t.co/CACglH6zPX',),
 ('This is important— What voices do you really trust in the artificial intelligence space? #AI \n\nLooking for a deep understanding of tech and applications, future-oriented',),
 ('More patients would prefer artificial intelligence to assess them for skin cancer than wait to see a doctor https://t.co/Alg6pXfRI1',),
 ('@cb_doge "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',),
 ('@SawyerMerritt "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',),
 ('@itsALLrisky "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',),
 ('@WholeMarsBlog "Trailblazing the cosmos with #AI_MOONSHOT, as artificial intelligence propels humanity towards unprecedented advancements." @ai_moonshot',)]

2. Data Preprocessing¶

Cleaning: Remove irrelevant content, special characters, and URLs. Normalization: Convert text to a standard format (e.g., lowercase, stemming).

In [6]:
# Define the tweet cleaning function
def clean_tweet(tweet):
    # Convert to lowercase
    tweet = tweet.lower()
    
    # Remove URLs
    tweet = re.sub(r'http\S+|www\S+|https\S+', '', tweet, flags=re.MULTILINE)
    
    # Remove @usernames and #hashtags
    tweet = re.sub(r'\@\w+|\#','', tweet)
    
    # Remove punctuation and special characters
    tweet = re.sub(r'[^\w\s]', '', tweet)
    
    # Tokenize the tweet
    tweet_tokens = word_tokenize(tweet)
    
    # Remove stopwords
    filtered_words = [word for word in tweet_tokens if word not in stopwords.words('english')]
    
    # Lemmatization
    lemmatizer = WordNetLemmatizer()
    lemmatized_words = [lemmatizer.lemmatize(word) for word in filtered_words]
    
    return " ".join(lemmatized_words)

# Assuming tweets_df is your DataFrame and 'Tweet' is the column with tweet texts
# Apply the cleaning function to each tweet
tweets_df['Cleaned_Tweet'] = tweets_df['Tweet'].apply(clean_tweet)

# Display the first few rows of the DataFrame
tweets_df.head()
Out[6]:
Tweet Timestamp Cleaned_Tweet
0 Artificial Intelligence is shitting with us! h... 2023-12-12 04:27:11+00:00 artificial intelligence shitting u
1 @ParagonRadio Where's the idol for the Artific... 2023-12-12 04:27:09+00:00 wheres idol artificial intelligence singularity
2 The Top AI Tools to Watch for in 2023: A Compr... 2023-12-12 04:27:03+00:00 top ai tool watch 2023 comprehensive guide art...
3 #Nasdaq $NVDA \n@CNBCnow \nI just started an A... 2023-12-12 04:25:31+00:00 nasdaq nvda started ai companywe produce artif...
4 Arena Group fires CEO in wake of Sports Illust... 2023-12-12 04:25:10+00:00 arena group fire ceo wake sport illustrated ai...
In [7]:
def drop_irrelevant_cols(tweets_df):
    # Drop the 'ContextAnnotations' column
    tweets_df = tweets_df.drop('Tweet', axis=1)

    # Display the DataFrame to confirm the column is dropped
    tweets_df.head()

drop_irrelevant_cols(tweets_df)
In [8]:
def filter_rows(tweets_df):
    # If the tweet does not contain the keywords then remove it
    # query words
    query_words = ['Artificial Intelligence', 'ai']

    # Create a boolean mask
    mask = tweets_df['Cleaned_Tweet'].str.contains('|'.join(query_words), case=False, na=False)

    # Filter the DataFrame
    filtered_tweets_df = tweets_df[mask]

    # Display the filtered DataFrame
    filtered_tweets_df.head()
    
filter_rows(tweets_df)

3. Sentiment Analysis¶

Sentiment Detection Tool: Use pre-built libraries like TextBlob. Classification: Classify the sentiment of each piece of text as positive, negative, or neutral.

In [9]:
# Function to apply sentiment analysis
def analyze_sentiment(tweet):
    analysis = TextBlob(tweet)
    polarity = analysis.sentiment.polarity
    if polarity > 0:
        return 'positive', polarity
    elif polarity == 0:
        return 'neutral', polarity
    else:
        return 'negative', polarity

# Apply the function to each tweet
tweets_df['Sentiment'], tweets_df['Polarity'] = zip(*tweets_df['Cleaned_Tweet'].apply(analyze_sentiment))

# Display the first few rows of the DataFrame with sentiment data
tweets_df.head()
Out[9]:
Tweet Timestamp Cleaned_Tweet Sentiment Polarity
0 Artificial Intelligence is shitting with us! h... 2023-12-12 04:27:11+00:00 artificial intelligence shitting u negative -0.600000
1 @ParagonRadio Where's the idol for the Artific... 2023-12-12 04:27:09+00:00 wheres idol artificial intelligence singularity negative -0.600000
2 The Top AI Tools to Watch for in 2023: A Compr... 2023-12-12 04:27:03+00:00 top ai tool watch 2023 comprehensive guide art... positive 0.033144
3 #Nasdaq $NVDA \n@CNBCnow \nI just started an A... 2023-12-12 04:25:31+00:00 nasdaq nvda started ai companywe produce artif... negative -0.304762
4 Arena Group fires CEO in wake of Sports Illust... 2023-12-12 04:25:10+00:00 arena group fire ceo wake sport illustrated ai... negative -0.600000
In [10]:
# Ensure your DataFrame has 'Sentiment' column from the sentiment analysis step
# Sentiment Distribution
plt.figure(figsize=(8, 6))
sns.countplot(x='Sentiment', data=tweets_df)
plt.title('Sentiment Distribution in Tweets')
plt.show()
In [11]:
plt.figure(figsize=(10, 6))
tweets_df.groupby('Timestamp')['Sentiment'].value_counts().unstack().plot(kind='line', marker='o')
plt.title('Sentiment Over Time')
plt.ylabel('Number of Tweets')
plt.xlabel('Date')
plt.show()
<Figure size 1000x600 with 0 Axes>
In [12]:
# Convert 'Timestamp' to datetime if not already
tweets_df['Timestamp'] = pd.to_datetime(tweets_df['Timestamp'])

# Filter tweets from 2022 to present date
tweets_df_filtered = tweets_df[tweets_df['Timestamp'].dt.year >= 2022]

# Ensure 'Sentiment' column exists and contains categorical data in the filtered DataFrame
if 'Sentiment' in tweets_df_filtered.columns and tweets_df_filtered['Sentiment'].isin(['positive', 'neutral', 'negative']).all():
    plt.figure(figsize=(10, 6))

    # Filter and group by Timestamp and Sentiment, then calculate cumulative sum
    cumulative_sentiment = tweets_df_filtered.groupby(['Timestamp', 'Sentiment']).size().unstack().cumsum()

    # Plot cumulative sentiment trends
    cumulative_sentiment.plot(figsize=(10, 6), marker='o')
    plt.title('Cumulative Sentiment Trends (2022 to Present)')
    plt.ylabel('Cumulative Number of Tweets')
    plt.xlabel('Date')
    plt.legend(title='Sentiment')
    plt.show()
else:
    print("Error: 'Sentiment' column not found or does not contain categorical data.")
<Figure size 1000x600 with 0 Axes>
In [13]:
# Word Cloud (for positive sentiment tweets as an example)
positive_tweets = ' '.join(tweets_df[tweets_df['Sentiment'] == 'positive']['Cleaned_Tweet'])
wordcloud = WordCloud(width=800, height=400, background_color ='white').generate(positive_tweets)

plt.figure(figsize=(10, 5))
plt.imshow(wordcloud, interpolation='bilinear')
plt.axis('off')
plt.title('Word Cloud for Positive Sentiment Tweets')
plt.show()
In [14]:
if tweets_df['Sentiment'].dtype == 'object':
    tweets_df['Sentiment'] = tweets_df['Sentiment'].astype('category')

4. Time Series Analysis¶

Aggregation: Aggregate sentiment scores over time (daily, weekly).

Trends Analysis: Use time series analysis techniques to identify trends. Libraries like Pandas and statsmodels can be helpful.

In [15]:
# Convert 'Timestamp' to datetime and set as index
tweets_df['Timestamp'] = pd.to_datetime(tweets_df['Timestamp'])

# Set 'Timestamp' as the index
tweets_df.set_index('Timestamp', inplace=True)

# Resample and aggregate sentiment scores
# calculating daily mean sentiment
daily_sentiment = tweets_df['Polarity'].resample('D').mean()

# Resample sentiment scores on a weekly basis (calculating mean polarity)
weekly_sentiment = tweets_df['Polarity'].resample('W').mean()

# Plot daily sentiment
plt.figure(figsize=(12, 6))
daily_sentiment.plot()
plt.title('Daily Average Sentiment Polarity')
plt.xlabel('Date')
plt.ylabel('Sentiment Polarity')
plt.grid(True)
plt.legend()
plt.show()

# Plotting weekly sentiment
plt.figure(figsize=(12, 6))
plt.plot(weekly_sentiment.index, weekly_sentiment.values, marker='o', linestyle='-', color='orange', label='Weekly')
plt.title('Weekly Average Sentiment Polarity Over Time')
plt.xlabel('Date')
plt.ylabel('Sentiment Polarity')
plt.grid(True)
plt.legend()
plt.show()

# Augmented Dickey-Fuller test for stationarity
# adf_test = adfuller(daily_sentiment.dropna())
# print('ADF Statistic:', adf_test[0])
# print('p-value:', adf_test[1])
# # Interpret the results (using a typical p-value threshold of 0.05)
# if adf_test[1] < 0.05:
#     print("The time series is likely stationary.")
# else:
#     print("The time series is likely non-stationary.")
C:\Users\mamad\anaconda3\Lib\site-packages\pandas\plotting\_matplotlib\core.py:1400: UserWarning: Attempting to set identical low and high xlims makes transformation singular; automatically expanding.
  ax.set_xlim(left, right)

Decomposition and Trend Analysis¶

In [16]:
# Decompose the time series data
decomposition = seasonal_decompose(tweets_df['Polarity'], period=30)  # Adjust period for seasonality

# Plot decomposed components
plt.figure(figsize=(12, 8))
trend = decomposition.trend
seasonal = decomposition.seasonal
residual = decomposition.resid

plt.subplot(411)
plt.plot(tweets_df.index, tweets_df['Polarity'], label='Original Data')
plt.legend()

plt.subplot(412)
plt.plot(tweets_df.index, trend, label='Trend')
plt.legend()

plt.subplot(413)
plt.plot(tweets_df.index, seasonal, label='Seasonal')
plt.legend()

plt.subplot(414)
plt.plot(tweets_df.index, residual, label='Residuals')
plt.legend()

plt.tight_layout()
plt.show()
In [17]:
# Check the columns in the 'tweets_df' DataFrame
print(tweets_df.columns)
Index(['Tweet', 'Cleaned_Tweet', 'Sentiment', 'Polarity'], dtype='object')
In [18]:
# Reset index to convert 'Timestamp' back to a column
tweets_df.reset_index(inplace=True)

# Check the columns after resetting the index
print(tweets_df.columns)
Index(['Timestamp', 'Tweet', 'Cleaned_Tweet', 'Sentiment', 'Polarity'], dtype='object')
In [19]:
# Convert 'Timestamp' to datetime if not already
tweets_df['Timestamp'] = pd.to_datetime(tweets_df['Timestamp'])

# Set 'Timestamp' as the index
tweets_df.set_index('Timestamp', inplace=True)

# Calculate rolling mean and rolling standard deviation
rolling_mean = tweets_df['Polarity'].rolling(window=30).mean()  # Adjust window size as needed
rolling_std = tweets_df['Polarity'].rolling(window=30).std()  # Adjust window size as needed

# Plot original data with rolling mean and rolling standard deviation
plt.figure(figsize=(12, 6))
plt.plot(tweets_df.index, tweets_df['Polarity'], label='Original Data', color='blue')
plt.plot(tweets_df.index, rolling_mean, label='Rolling Mean (30-day)', color='red')
plt.plot(tweets_df.index, rolling_std, label='Rolling Std (30-day)', color='green')
plt.title('Trend Analysis: Original Data with Rolling Statistics')
plt.xlabel('Date')
plt.ylabel('Sentiment Polarity')
plt.legend()
plt.grid(True)
plt.show()

5. Forecasting¶

Model Selection: Choose a forecasting model like ARIMA, SARIMA, or LSTM (for deep learning approaches).

Prediction: Use the model to predict future trends in sentiment and discussion volume.

In [20]:
# Reset index to convert 'Timestamp' back to a column
tweets_df.reset_index(inplace=True)

# Check the columns after resetting the index
print(tweets_df.columns)
Index(['Timestamp', 'Tweet', 'Cleaned_Tweet', 'Sentiment', 'Polarity'], dtype='object')
In [23]:
def forecasting(tweets_df):
    # Split the data into training and testing sets (adjust according to your data)
    train_size = int(len(tweets_df) * 0.8)
    train_data, test_data = tweets_df[:train_size], tweets_df[train_size:]

    # Fit ARIMA model (adjust p, d, q values)
    p, d, q = 5, 1, 0  # Example values, tune based on autocorrelation analysis
    model = ARIMA(train_data['Polarity'], order=(p, d, q))
    arima_model = model.fit()

    # Forecast future values
    forecast_values = arima_model.forecast(steps=len(test_data))  # Adjust steps for forecasting horizon

    # Evaluation (calculate RMSE)
    mse = mean_squared_error(test_data['Polarity'], forecast_values)
    rmse = np.sqrt(mse)
    print(f"Root Mean Squared Error (RMSE): {rmse}")
    print(forecast_values)

    # Plotting actual vs predicted values
    plt.figure(figsize=(10, 6))
    plt.plot(test_data['Timestamp'], test_data['Polarity'], label='Actual')
    plt.plot(test_data['Timestamp'], forecast_values, label='Predicted', color='red')
    plt.title('ARIMA Forecasting: Actual vs Predicted Sentiment')
    plt.xlabel('Timestamp')
    plt.ylabel('Polarity')
    plt.legend()
    plt.show()

forecasting(tweets_df)
Root Mean Squared Error (RMSE): 0.23432853748137872
2024-03-01 04:27:11+00:00   -0.195598
2024-03-02 04:27:11+00:00   -0.173605
2024-03-03 04:27:11+00:00   -0.163632
2024-03-04 04:27:11+00:00   -0.207377
2024-03-05 04:27:11+00:00   -0.197764
2024-03-06 04:27:11+00:00   -0.224519
2024-03-07 04:27:11+00:00   -0.202567
2024-03-08 04:27:11+00:00   -0.194758
2024-03-09 04:27:11+00:00   -0.193690
2024-03-10 04:27:11+00:00   -0.200965
2024-03-11 04:27:11+00:00   -0.202217
2024-03-12 04:27:11+00:00   -0.204818
2024-03-13 04:27:11+00:00   -0.201434
2024-03-14 04:27:11+00:00   -0.199588
2024-03-15 04:27:11+00:00   -0.199503
2024-03-16 04:27:11+00:00   -0.200848
2024-03-17 04:27:11+00:00   -0.201423
2024-03-18 04:27:11+00:00   -0.201654
2024-03-19 04:27:11+00:00   -0.201045
2024-03-20 04:27:11+00:00   -0.200653
Freq: D, Name: predicted_mean, dtype: float64
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
File ~\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3802, in Index.get_loc(self, key, method, tolerance)
   3801 try:
-> 3802     return self._engine.get_loc(casted_key)
   3803 except KeyError as err:

File ~\anaconda3\Lib\site-packages\pandas\_libs\index.pyx:138, in pandas._libs.index.IndexEngine.get_loc()

File ~\anaconda3\Lib\site-packages\pandas\_libs\index.pyx:165, in pandas._libs.index.IndexEngine.get_loc()

File pandas\_libs\hashtable_class_helper.pxi:5745, in pandas._libs.hashtable.PyObjectHashTable.get_item()

File pandas\_libs\hashtable_class_helper.pxi:5753, in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: 'Timestamp'

The above exception was the direct cause of the following exception:

KeyError                                  Traceback (most recent call last)
Cell In[23], line 30
     27     plt.legend()
     28     plt.show()
---> 30 forecasting(tweets_df)

Cell In[23], line 22, in forecasting(tweets_df)
     20 # Plotting actual vs predicted values
     21 plt.figure(figsize=(10, 6))
---> 22 plt.plot(test_data['Timestamp'], test_data['Polarity'], label='Actual')
     23 plt.plot(test_data['Timestamp'], forecast_values, label='Predicted', color='red')
     24 plt.title('ARIMA Forecasting: Actual vs Predicted Sentiment')

File ~\anaconda3\Lib\site-packages\pandas\core\frame.py:3807, in DataFrame.__getitem__(self, key)
   3805 if self.columns.nlevels > 1:
   3806     return self._getitem_multilevel(key)
-> 3807 indexer = self.columns.get_loc(key)
   3808 if is_integer(indexer):
   3809     indexer = [indexer]

File ~\anaconda3\Lib\site-packages\pandas\core\indexes\base.py:3804, in Index.get_loc(self, key, method, tolerance)
   3802     return self._engine.get_loc(casted_key)
   3803 except KeyError as err:
-> 3804     raise KeyError(key) from err
   3805 except TypeError:
   3806     # If we have a listlike key, _check_indexing_error will raise
   3807     #  InvalidIndexError. Otherwise we fall through and re-raise
   3808     #  the TypeError.
   3809     self._check_indexing_error(key)

KeyError: 'Timestamp'
<Figure size 1000x600 with 0 Axes>

6. Visualization¶

Tools: Use libraries like Matplotlib or Plotly to visualize trends and forecasts.

Dashboard: Consider building a dashboard using Dash or Streamlit for real-time analysis and visualization.

In [22]:
# Assuming 'tweets_df' contains your time series data with a 'Timestamp' column and 'Polarity' values
# Convert 'Timestamp' to datetime if not already
tweets_df['Timestamp'] = pd.to_datetime(tweets_df['Timestamp'])

# Set 'Timestamp' as the index
tweets_df.set_index('Timestamp', inplace=True)

# Ensure the index is monotonic and has a frequency (e.g., 'D' for daily, 'M' for monthly, etc.)
# Replace 'D' with the appropriate frequency for your data
tweets_df.index = pd.date_range(start=tweets_df.index[0], periods=len(tweets_df), freq='D')

# Function to load data
def load_data():
    # Replace this with your actual data loading logic
    data = pd.DataFrame({
        'Timestamp': pd.date_range(start='2023-01-01', periods=100, freq='D'),
        'Sentiment': np.random.randint(-1, 2, 100)
    })
    return data

# Load data
data = load_data()

# Plotting with Plotly
fig = px.line(data, x='Timestamp', y='Sentiment', title='Sentiment Trend')
fig.show()